package com.ldzy.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.ldzy.dao.BuyMapper;
import com.ldzy.pojo.Buy;
import com.ldzy.service.BuyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class BuyServiceImpl implements BuyService {
    @Autowired
    BuyMapper buyMapper;

    @Override
    public List<Buy> search(int page,int size) {
        PageHelper.startPage(page,size);
        return buyMapper.search(page,size);
    }

    @Override
    public int add(Buy buy) {
        return buyMapper.add(buy);
    }
}
